<template>
<div>
    <div>
      <el-form ref="tableData" :model="tableData" label-width="80px">
        <el-form-item label="写字楼">
        </el-form-item>
        <el-form-item label="业主名字">
          <el-input v-model="tableData.name"></el-input>
        </el-form-item>
      </el-form>
      <el-button type="primary" icon="el-icon-search" @click="listdf('tableData')">搜索</el-button>
      <el-button type="primary" icon="el-icon-refresh-right" @click="listdfall()">重置</el-button>
      <!--<router-link to="/user/add"><el-button class="el-icon-circle-plus-outline" type="primary" >-->
      <!--添加-->
      <!--</el-button></router-link>-->
    </div>
    <div>
      <el-table
        :data="tableData"
        style="width: 100%">
        <el-table-column
          label="时间月份"
          width="180">
          <template slot-scope="scope">
            <span style="margin-left: 10px">{{ scope.row.time }}</span>
          </template>
        </el-table-column>
        <el-table-column
          label="应收电费"
          width="180">
          <template slot-scope="scope">
            <span style="margin-left: 10px">{{ scope.row.ysf }}</span>
          </template>
        </el-table-column>
        <el-table-column
          label="实收电费"
          width="180">
          <template slot-scope="scope">
            <span style="margin-left: 10px">{{ scope.row.ssf }}</span>
          </template>
        </el-table-column>
        <el-table-column
          align="left">
        </el-table-column>
        <el-table-column
          label="收费率"
          width="180">
          <template slot-scope="scope">
            <span style="margin-left: 10px">{{ scope.row.sfl }}</span>
          </template>
        </el-table-column>
        <el-table-column
          label="分解"
          width="180">
          <template slot-scope="scope">
            <span style="margin-left: 10px">{{ scope.row.fj }}</span>
          </template>
        </el-table-column>
      </el-table>
    </div>
</div>
</template>

<script>
export default {
  name: 'df',
  data () {
    return {
      tableData: [],
      dialogVisible: false,
      addVisible: false,
      input: [],
      add: [
        {
          ysf: '',
          ssf: '',
          sfl: '',
          fj: '',
          time: ''
        }
      ]
    }
  },
  mounted () {
    this.listsfall()
    this.listsf()
    this.adddf()
  },
  methods: {
    async listsf () {
      const { data: res } = await this.$axios.post('/listdf')
      this.tableData = res.dfs
    },
    async listsfall () {
      const { data: res } = await this.$axios.post('/listdfall')
      this.tableData = res.dfs
    },
    async adddf () {
      const { data: res } = await this.$axios.post('/adddf')
      this.tableData = res.dfs
    }
  }
}
</script>

<style scoped>

</style>
